package assignment1;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * Combo Class:
 * This class extends the Product Class, and is used to create a Combo "Product", given a burger as the main product, and an integer defining the combo size
 * @author Vale
 *
 */
public class Combo extends Product {

    private int comboSize = 1;
    private Burger mainProd;
    private Drink comboDrink = new Drink();
    private Chips comboChips = new Chips();
    private final String INV_SIZE = "Not a valid combo size";
    private final String COMBO = " Combo";
    private final String SMALL_SIZE = "Small";
    private final String MED_SIZE = "Medium";
    private final String LARGE_SIZE = "Large";

    /**
     * Product getMainProd() Method:
     * Return the Main Product of the Combo
     * @return Return main Product
     *
     */
    public Product getMainProd() {
        return mainProd;
    }

    /**
     * void setMainProd(Burger mainProd) Method:
     * Set the main Product to mainProd
     * @param mainProd This is the main product for the combo
     *
     */
    public void setMainProd(Burger mainProd) {
        this.mainProd = mainProd;
    }

    /**
     * void setProdName() Method:
     * Set the product name of the combo
     *
     */
    public void setProdName() {
        this.setProdName(mainProd.getProdName() + COMBO);
    }

    /**
     * int getComboSize() Method:
     * Return the Combo Size
     * @return Return combo size
     *
     */
    public int getComboSize() {
        return comboSize;
    }

    /**
     * void setComboSize(int comboSize) Method:
     * Set the combo size, pending on input
     * @param comboSize This is the size of the combo
     *
     */
    public void setComboSize(int comboSize) {
        this.comboSize = comboSize;
    }

    /**
     * void makeCombo(Burger mainProd, int comboSize, String drinkName) Method:
     * Set the Main Product, combo size and all instance variables for the combo, based on the values inputted
     * @param mainProd This is the main product of the combo - the Burger
     * @param comboSize This is the size of the combo as ana integer (1 = small, 2 = medium, 3 = large)
     * @param drinkName This is the name of the drink for the combo
     * @return Return the increase in cost pending on the combo size
     *
     */
    public void makeCombo(Burger mainProd, int comboSize, String drinkName) {
        this.mainProd = mainProd;
        this.setProdName(mainProd.getProdName() + COMBO);
        this.comboSize = comboSize;
        this.comboDrink.setDrinkSize(comboSize);
        this.comboChips.setChipSize(comboSize);
        this.comboDrink.setDrinkName(drinkName);
        this.setComboPrice();
    }

    /**
     * void setComboPrice() Method:
     * Set Combo priced based on combo size
     * @return Return the increase in cost pending on the combo size
     *
     */
    public void setComboPrice() {
        switch (this.comboSize) {
            case 1:
                this.setProdCost(mainProd.getProdCost() + 1.50);
                break;
            case 2:
                this.setProdCost(mainProd.getProdCost() + 2.00);
                break;
            case 3:
                this.setProdCost(mainProd.getProdCost() + 2.50);
                break;
            default:
                System.out.println(INV_SIZE);
                break;
        }
    }

    /**
     * String getDrinkName() Method:
     * Return the Drink Name
     * @return Return drink name
     *
     */
    public String getDrinkName() {
        return comboDrink.getDrinkName();
    }

    /**
     * String convertComboSize(int comboSize) Method:
     * Get string equivalent of Combo size, depending on the integer representation of combo size
     * @param comboSize Represents the size of the combo, as an integer
     * @return Return the increase in cost pending on the combo size
     *
     */
    public String convertComboSize(int comboSize) {
        switch (comboSize) {
            case 1:
                return SMALL_SIZE;
            case 2:
                return MED_SIZE;
            case 3:
                return LARGE_SIZE;
            default:
                return "";
        }
    }
}